<!doctype html>
<html class="no-js">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>南京大学职业咨询预约平台</title>
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <!-- No Baidu Siteapp-->
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='assets/i/ico_128X128.ico') }}">
    <!-- Add to homescreen for Chrome on Android -->
    <meta name="mobile-web-app-capable" content="yes">
    <link rel="icon" sizes="192x192" href="{{ url_for('static', filename='assets/i/app-icon72x72@2x.png') }}">
    <!-- Add to homescreen for Safari on iOS -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="apple-touch-icon-precomposed" href="{{ url_for('static', filename='assets/i/app-icon72x72@2x.png') }}">
    <!-- Tile icon for Win8 (144x144 + tile color) -->
    <meta name="msapplication-TileImage" content="{{ url_for('static', filename='assets/i/app-icon72x72@2x.png') }}">
    <meta name="msapplication-TileColor" content="#0e90d2">
    <link rel="stylesheet" href="{{ url_for('static', filename='assets/css/amazeui.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='assets/css/app.css', v='1.4') }}">
    <script src="{{ url_for('static', filename='assets/js/jquery.min.js') }}"></script>
    <style>
    
    .am-cf {
        text-align: center;
        float: none;
    }
    
    .main {
        text-align: center;
        margin-top:50px;
    }

    .main table tr td {
        border-top:0;
    }

    </style>
</head>

<body>
<div class="admin-header">
    <!--<div class="header-back" onclick="history.back()">返回</div>-->
    <div class="header-title">咨询师/管理员入口</div>
</div>
<div class="admin-content">
    <div class="alert alert-warning">
        {% with messages = get_flashed_messages() %}
          {% if messages %}
            <ul class=flashes>
            {% for message in messages %}
            <div class="am-alert am-alert-secondary" data-am-alert>
              <button type="button" class="am-close">&times;</button>
              <div style="text-align: center;">{{ message }}</div>
            </div>
            {% endfor %}
            </ul>
          {% endif %}
        {% endwith %}
    </div>
     <div class="main">
        <form method="post" name="njusub" onsubmit="return checkInput()">
            {{ form.csrf_token }}
            <table class="am-table am-table-centered" id="table1" cellpadding="0" cellspacing="0" style="border:none;">
                <tr>
                    <td>&nbsp;</td>
                    <td><label>电话</label></td>
                    <td><input type="text" class="am-form-field" name="contact" id="id_con" value="{{coct}}" style="width:100%;height: 100%;" placeholder="手机号为登录和查询账号"></td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td><label>密码</label></td>
                    <td><input type="password" class="am-form-field" name="password" id="id_pw" autocomplete="off" value="{{copw}}" style="width:100%;height: 100%;"  placeholder="密码不能少于6位，请牢记"></td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>
                      <label style="float:left;">
                        <input type="checkbox" {{corm}} id="rememberme" name="rememberme">&nbsp;记住密码
                      </label>
                    </td>
                    <td>&nbsp;</td>
                </tr>
            </table>


            <div>&nbsp;</div>
            <div class="am-cf">
                <button type="submit" name="logon" value="登入系统" onclick="login()" class="am-btn am-btn-primary am-btn-sm">登入系统</button>
                <button type="button" name="forget" value="忘记密码" onclick="forgetpw()" class="am-btn am-btn-default am-btn-sm">忘记密码</button>
            </div>
        </form>
    </div>
</div>



    
    <script type="text/javascript">
    function checkIsTeleNum(a) {
        var validTeleNum = /^0?1[3|4|5|7|8][0-9]\d{8}$/;
        return validTeleNum.test(a);
    }

    function checkInvalidPassword(a) {
        if (a == undefined || a.length < 6) {
            return false;
        };

        return true;
    }

    function login(){
        document.njusub.action="/login";
        document.njusub.submit();
    }

    function forgetpw(){
        if (checkIsTeleNum($("#id_con").val())) {
            document.njusub.action="/tch_forget_password";
            document.njusub.submit();
        }else{
            alert("您输入的电话号码不正确！");
            return false;
        };
    }

    function checkInput() {
        if (checkIsTeleNum($("#id_con").val())==false){
            alert("您输入的电话号码不正确！");
            return false;
        } 

        /*if (checkInvalidPassword($("#id_pw").val())==false) {
            alert("您输入的密码不正确！");
            return false;
        }*/

        return true;
    }
    </script>
    
    <!--[if (gte IE 9)|!(IE)]><!-->
    <script src="{{ url_for('static', filename='assets/js/jquery.min.js') }}"></script>
    <!--<![endif]-->
    <!--[if lte IE 8 ]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<![endif]-->
    <script src="{{ url_for('static', filename='assets/js/amazeui.min.js') }}"></script>
</body>
</html>
